using System;
using System.Runtime.InteropServices;
namespace BMC.ARSystem
{
	[ARStructTypeInfo(Name = "ARAlertMessageStruct", NumberOfMembers = 4u), ClassInterface, Guid("b9814cb1-a969-4844-bf9b-57534882cdce"), ProgId("BMC.ARSystem.AlertMessage")]
	public class AlertMessage
	{
		[Guid("68ce06f0-0284-4661-99b2-611f92081e57")]
		public enum AlertSourceType
		{
			GeneralPurpose = 1,
			ARSystem,
			FirstContactIndicator,
			AccessibilityCheck,
			Flashboards
		}
		private DateTime _timestamp;
		private uint _sourceType;
		private uint _priority;
		private string _alertText;
		private string _sourceTag;
		private string _serverName;
		private string _serverAddr;
		private string _formName;
		private string _objectId;
		private string _user;
		private string _entryId;
		public DateTime LastTime
		{
			get
			{
				return this._timestamp;
			}
		}
		public AlertMessage.AlertSourceType SourceType
		{
			get
			{
				return (AlertMessage.AlertSourceType)this._sourceType;
			}
		}
		public uint Priority
		{
			get
			{
				return this._priority;
			}
		}
		public string AlertText
		{
			get
			{
				return this._alertText;
			}
		}
		public string SourceTag
		{
			get
			{
				return this._sourceTag;
			}
		}
		public string ServerName
		{
			get
			{
				return this._serverName;
			}
		}
		public string ServerAddress
		{
			get
			{
				return this._serverAddr;
			}
		}
		public string FormName
		{
			get
			{
				return this._formName;
			}
		}
		public string ObjectId
		{
			get
			{
				return this._objectId;
			}
		}
		public string User
		{
			get
			{
				return this._user;
			}
		}
		public string EntryId
		{
			get
			{
				return this._entryId;
			}
		}
		private AlertMessage()
		{
			this._entryId = "";
		}
		public AlertMessage(string user, string alertText, uint priority, AlertMessage.AlertSourceType sourceType, string serverName, string formName, string objectId) : this()
		{
			this._user = user;
			this._alertText = alertText;
			this._priority = priority;
			this._sourceType = (uint)sourceType;
			this._serverName = serverName;
			this._formName = formName;
			this._objectId = objectId;
		}
		internal AlertMessage(object[] rawData, Server server) : this()
		{
			this._timestamp = Util.GetDateTime(Convert.ToUInt32(Util.GetAt(rawData, new int[]
			{
				5
			})));
			this._sourceType = (uint)Util.GetAt(rawData, new int[]
			{
				6
			});
			this._priority = (uint)Util.GetAt(rawData, new int[]
			{
				7
			});
			this._alertText = (string)Util.GetAt(rawData, new int[]
			{
				8
			});
			this._sourceTag = (string)Util.GetAt(rawData, new int[]
			{
				9
			});
			this._serverName = (string)Util.GetAt(rawData, new int[]
			{
				10
			});
			this._serverAddr = (string)Util.GetAt(rawData, new int[]
			{
				11
			});
			this._formName = (string)Util.GetAt(rawData, new int[]
			{
				12
			});
			this._objectId = (string)Util.GetAt(rawData, new int[]
			{
				13
			});
			this._user = server.User;
		}
		internal static AlertMessage createInstance(object[] rawData, Server server)
		{
			return new AlertMessage(rawData, server);
		}
		internal void SetEntryId(string entryId)
		{
			this._entryId = entryId;
		}
		public override string ToString()
		{
			return string.Format("{0} ({1}) ({2}({3})): {4}", new object[]
			{
				this.SourceType,
				this.Priority,
				this.ServerName,
				this.FormName,
				this.AlertText
			});
		}
	}
}
